package com.leador.map.api.location;

public class RequestLocationEntity {
	public long minTime;
	public float minDistance;
	public MapLocationListener listener;
	public long lastTime; // 记录上次定位成功的时间点
	public boolean isToLocation = true; // 是否去定位
	public MapLocation location = null; // 定位的位置
	public String provider;

	public RequestLocationEntity(long minTime, float minDistance,
			MapLocationListener listener, String provider) {
		this.minTime = minTime;
		this.minDistance = minDistance;
		this.listener = listener;
		this.provider = provider;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((listener == null) ? 0 : listener.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RequestLocationEntity other = (RequestLocationEntity) obj;
		if (listener == null) {
			if (other.listener != null)
				return false;
		} else if (!listener.equals(other.listener))
			return false;
		return true;
	}
}
